<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page pageEncoding="UTF-8" %>
<%@ page import="java.util.*,jp.co.technotree.apl.cmd.systemlog1000.*,jp.co.technotree.common.util.*" %>
<%@ include file="../common/common.jsp"%>
<jsp:useBean id="formBean" class="jp.co.technotree.apl.cmd.systemlog1000.Log1000Bean" scope="request" />

<%

Log1000Bean.Record parentRecord = formBean.getParentRecord();
Log1000Bean.Record[] childRecordList = formBean.getChildRecordList();

%>

<html>
	<head>
		<title>ログ詳細情報</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="Content-Script-Type" content="text/javascript">
		<meta http-equiv="Content-Style-Type" content="text/css">

		<script>
		<!--
		-->
		</script>

		<link rel='stylesheet' type='text/css' href='../../common/css/common/base.css' >
		<link rel='stylesheet' type='text/css' href='../../common/css/common/common.css'>
		<link rel='stylesheet' type='text/css' href='../../common/css/systemlog/log.css'>
		<link rel='stylesheet' type='text/css' href='../../common/css/systemlog/log1000.css'>

		<style type="text/css">
		<!--
		.freezing_row {
			z-index: 10;
			position: relative;
			top: expression(this.offsetParent.scrollTop)
		}
		-->
		</style>

		<script TYPE="text/javascript">
		<!--


		function viewOnClick(type) {
			var frm = document["main"];

			frm["outputCate"].value = type;
			frm.submit();
		}

		function checkSubmit() {
			var frm = document["main"];

			frm["checkSubmitFlg"].value = "1";
			frm.submit();
		}

		function changeColumnSort(key) {
			var formName = "main";
			var formObj = document[formName];
			formObj.columnSortSelect.value = key;
			formObj.submit();
		}


		-->
		</script>

	</head>

	<body onLoad="">
		<form name="main" method="POST" action="log1000.fw">
			<table width="100%" cellspacing="0" cellpadding="0" border="0">
				<tr>
					<td>
						<table class="main-width-tb" cellspacing="0" cellpadding="0" border="0"><tr><td></td></tr></table>
						<table class="main-height-tb" cellspacing="0" cellpadding="0" border="0"><tr><td></td></tr></table>
						<!-- メインコンテンツ -->
						<div id="lc-out">
							<div id="lc-in">

								<div id="lc-cc-in" class="lc-cc-in">
									<!-- アップロード START -->
									<div class="box-out">
										<div style="font-size: 12pt;">基本情報</div>
										<div class="box-in">
											<table cellspacing="4" cellpadding="2" border="0" class="def-info">
<%	if (parentRecord != null) { %>
												<tr>
													<td colspan="2" class="td-left" style="width: 110px;"><%= parentRecord.logDatetime %></td>
													<td></td>
													<td rowspan="4" class="td-right" style="width: 300px;">

<%		if (parentRecord != null && "Y".equals(parentRecord.checkFlg)) { %>
														<span class="txt-conf">確認済み</span>
<%		} else { %>
														<!--<span class="txt-conf">確認済み</span>-->
														<!--  <input class="btn-conf" type="button" value="確認" onclick="checkSubmit();">-->
<%		} %>
													</td>
												</tr>
												<tr>
													<td style="width: 8px;"></td>
													<td colspan="2"><%= parentRecord.logText %></td>
												</tr>
												<tr>
													<td style="width: 8px;"></td>
													<td style="width: 100px;">ファイル名：</td>
													<td class="td-left"><%= parentRecord.target1Cd %></td>
												</tr>
												<tr>
													<td style="width: 8px;"></td>
													<td style="width: 100px;">エラー数：</td>
													<td class="td-left"><%= formBean.getErrorCount() %>回</td>
												</tr>
<%	} else { %>
												<tr>
													<td>データがありません。</td>
												</tr>
<%	} %>
											</table>
										</div><!--box-in-->
									</div><!--box-out-->
								</div><!--lc-cc-in -->

								<!--ログ情報 START -->
								<div id="lc-his-in" class="lc-his-in" >
									<div class="box-out">
										<div class="box-tab">
<%	String tabSelect0 = "tab"; %>
<%	String tabSelect1 = "tab"; %>
<%	String tabSelect2 = "tab"; %>

<%	if ("1".equals(formBean.getOutputCate())) { %>
<%		tabSelect1 = "tab-selected"; %>
<%	} else if ("2".equals(formBean.getOutputCate())) { %>
<%		tabSelect2 = "tab-selected"; %>
<%	} else { %>
<%		tabSelect0 = "tab-selected"; %>
<%	} %>
											<div class="<%= tabSelect0 %>">
												<table cellspacing="0" cellpadding="0" border="0" class="tab-out">
													<tr>
														<td class="tab-rl"></td>
														<td class="tab-t"></td>
														<td class="tab-rr"></td>
													</tr>
													<tr>
														<td class="tab-l"></td>
														<td class="tab-c"><div class="tab-title"><span id="tab01"><a id="tabtext01" href="javaScript:viewOnClick('0');">全て&nbsp;<%= formBean.getAlertCount() + formBean.getErrorCount() %>件</a></span></div></td>
														<td class="tab-r"></td>
													</tr>
												</table>
											</div>

											<div class="<%= tabSelect1 %>">
												<table cellspacing="0" cellpadding="0" border="0" class="tab-out">
													<tr><td class="tab-rl"></td><td class="tab-t"></td><td class="tab-rr"></td></tr>
													<tr><td class="tab-l"></td><td class="tab-c"><div class="tab-title"><span id="tab02"><a id="tabtext02" href="javaScript:viewOnClick('1');">警告&nbsp;<%= formBean.getAlertCount() %>件</a></span></div></td><td class="tab-r"></td></tr>
												</table>
											</div>

											<div class="<%= tabSelect2 %>">
												<table cellspacing="0" cellpadding="0" border="0" class="tab-out">
													<tr><td class="tab-rl"></td><td class="tab-t"></td><td class="tab-rr"></td></tr>
													<tr><td class="tab-l"></td><td class="tab-c"><div class="tab-title"><span id="tab02"><a id="tabtext02" href="javaScript:viewOnClick('2');">エラー&nbsp;<%= formBean.getErrorCount() %>件</a></span></div></td><td class="tab-r"></td></tr>
												</table>
											</div>
										</div><!-- box-tab -->

										<div class="box-in">
											<div class="box-inner tab_detail">
												<table class="detail-list" cellspacing="0" cellpadding="4" border="0">
													<tr class="freezing_row">
														<th onclick="changeColumnSort('log_datetime');" style="width: 130px; cursor:pointer;">時刻<%=formBean.getSort().getSortText("log_datetime")%></th>
														<th onclick="changeColumnSort('alert_level');" style="width: 65px; cursor:pointer;">種別<%=formBean.getSort().getSortText("alert_level")%></th>
														<th onclick="changeColumnSort('log_topic');" style="width: 100px; cursor:pointer;">種類<%=formBean.getSort().getSortText("log_topic")%></th>
														<th onclick="changeColumnSort('log_text');" style="width: 290px; cursor:pointer;">メッセージ<%=formBean.getSort().getSortText("log_text")%></th>
														<th style="width: 330px;">ヒント</th>
														<th style="width: 20px;">&nbsp;</th>
													</tr>
<%	if (childRecordList != null && 0 < childRecordList.length) { %>
<%		for (int i = 0; i < childRecordList.length; i++) { %>
<%			Log1000Bean.Record record = childRecordList[i]; %>
<%			String alertLevelStr   = null; %>
<%			String alertLevelStyle = null; %>

<%			if ("ALR".equals(record.alertLevel)) { %>
<%				alertLevelStr   = "警告"; %>
<%				alertLevelStyle = "td-warn"; %>
<%			} else if ("ERR".equals(record.alertLevel)) { %>
<%				alertLevelStr   = "エラー"; %>
<%				alertLevelStyle = "td-error"; %>
<%			} else if ("INF".equals(record.alertLevel)) { %>
<%				alertLevelStr   = "情報"; %>
<%				alertLevelStyle = "td-info"; %>
<%			} else { %>
<%				alertLevelStr   = ""; %>
<%				alertLevelStyle = ""; %>
<%			} %>
													<tr>
														<td class="td-left"><%= record.logDatetime %></td>
														<td class="td-left <%= alertLevelStyle %>" ><%= alertLevelStr %></td>
														<td class="td-left"><%= record.logTopic %></td>
														<td class="td-left"><%= record.logText %></td>
														<td class="td-left"><%= record.hintMsg %></td>
														<td class="td-left">
<%			if (record.linkUrl != null && !record.linkUrl.equals("")) { %>
<%				String url = record.linkUrl; %>
<%				if (record.linkKey != null && !record.linkKey.equals("")) { %>
<%					url += "?" + record.linkKey; %>
<%				} %>
															<input type="button" value="詳細" onclick="window.location.href='<%= url %>'">
<%			} else { %>
															&nbsp;
<%			} %>
														</td>
													</tr>
<%		} %>
<%	} else { %>
													<tr class="td-left">
														<td colspan="6" style="height:100px;">詳細データがありません。</td>
													</tr>
<%	} %>
												</table>
											</div><!--  box-inner -->
										</div><!-- box-in -->
									</div><!--  box-out -->
								</div><!--  lc-his-in -->
								<!-- ログ情報END -->

								<!-- ボタン枠 START -->
								<div id="under-btn" class="under-btn" >
									<table cellspacing="0" cellpadding="0" border="0">
										<tr>
											<!--<td style="width: 6%;text-align: center;"><input type="button" value="確認" onclikc="checkSubmit();" class="under-btnsize">&nbsp;&nbsp;</td>-->
											<td style="width: 94%;" align="left"><input type="button" value="閉じる"class="under-btnsize" onclick="window.close();"></td>
										</tr>
									</table>
								</div>
								<!-- ボタン枠 END -->
							</div><!--lc-in-->

						</div><!-- lc-out -->
						<!-- メインコンテンツ終了 -->
					</td>
				</tr>
			</table>

			<input type="hidden" name="outputCate" value="<%= formBean.getOutputCate() %>" >
			<input type="hidden" name="parentId" value="<%= formBean.getParentId() %>" >
			<input type="hidden" name="checkSubmitFlg" value="0" >
			<!-- カラムソート -->
			<input type="hidden" name="columnSortText" value="<%=formBean.getColumnSortText()%>">
			<input type="hidden" name="columnSortSelect" value="">

		</form>
	</body>
</html>



